import java.util.*;

public class code3 {
    //除2
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),k = sc.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b)->{
            return b-a;
        });
        long sum=0,x=0;
        //存入堆
        for(int i=0;i<n;i++) {
            x = sc.nextLong();
            sum+=x;
            if(x%2==0) heap.add((int)x);
        }
        //进行k次操作
        while(!heap.isEmpty()&&k--!=0) {
            int t = heap.poll()/2;
            sum-=t;
            if(t%2==0) heap.add(t);
        }
        System.out.print(sum);
    }
}